import request from '@/utils/request'
const BASE_URL = '/apis'

// 查询Dashboard概览
export function getDashboardOverview() {
  return request({
    url: BASE_URL + '/api/v1/dashboard/overview',
    method: 'get'
  })
}

// 查询活跃用户数
export function getDashboardUsersView(query) {
  return request({
    url: BASE_URL + '/api/v1/dashboard/users_view' + query,
    method: 'get'
  })
}

// 任务数量排行TOP10的用户
export function getDashboardTopUsers() {
  return request({
    url: BASE_URL + '/api/v1/dashboard/top_users_jobs',
    method: 'get'
  })
}

// 用户任务时长排行版
export function getDashboardTopUsersHours(query) {
  return request({
    url: BASE_URL + '/api/v1/dashboard/top_users_hours' + query,
    method: 'get'
  })
}

// 新建任务数
export function getDashboardJobsView(query) {
  return request({
    url: BASE_URL + '/api/v1/dashboard/jobs_view' + query,
    method: 'get'
  })
}

// 耗时任务排行
export function getDashboardTopJobsHoursView(query) {
  return request({
    url: BASE_URL + '/api/v1/dashboard/top_jobs_hours_view' + query,
    method: 'get'
  })
}

// 任务统计分析 （成功失败）
export function getDashboardJobsStatusView(query) {
  return request({
    url: BASE_URL + '/api/v1/dashboard/jobs_status_view' + query,
    method: 'get'
  })
}

// GPU利用率
export function getDashboardResourceGpuUtilView(query) {
  return request({
    url: BASE_URL + '/api/v1/dashboard/resource_gpu_util_view' + query,
    method: 'get'
  })
}

// GPU分配率
export function getDashboardResourceGpuAllocateView(query) {
  return request({
    url: BASE_URL + '/api/v1/dashboard/resource_gpu_allocate_view' + query,
    method: 'get'
  })
}

// CPU分配率
export function getDashboardResourceCpuView(query) {
  return request({
    url: BASE_URL + '/api/v1/dashboard/resource_cpu_view' + query,
    method: 'get'
  })
}

// 内存使用率
export function getDashboardResourceMemoryView(query) {
  return request({
    url: BASE_URL + '/api/v1/dashboard/resource_memory_view' + query,
    method: 'get'
  })
}
